<cfset sourceImage = ImageRead('#request.basepath#images/temp/#cookie.imagefile#')>
<cfparam name="backgroundColor" default="white" type="regex" pattern="[A-Za-z0-9##]+">	
<cfparam name="shadowcolor" default="gray" type="regex" pattern="[A-Za-z0-9##]+">
<cfparam name="shadowwidth" default="3">
<cfparam name="shadowDistance" default="4">

<cfset lastcount = cookie.current_step>
<cfset nextcount = cookie.current_step + 1>
<cfset lastcount = "#lastcount#_">
<cfset nextcount = "#nextcount#_">

<cfset backgroundcolor = replace(backgroundcolor, "##", "")>
<cfset shadowcolor = replace(shadowcolor, "##", "")>

<cfinvoke component="cfcs.common.cfimageeffects" method="init" returnvariable="effects">

<cfset reflectedImage = effects.applyDropShadowEffect(sourceImage, backgroundcolor, shadowColor, shadowWidth, shadowDistance)>
<cfset oldimage = '#request.basepath#images/temp/#cookie.imagefile#'>
<cfset newimage = "#request.basepath#images/temp/#replace(cookie.imagefile, lastcount, nextcount)#">

<cfcookie name = "imagefile" value="#replace(cookie.imagefile, lastcount, nextcount)#">
<cfset nextstep = cookie.current_step + 1>
<cfcookie name = "current_step" value="#nextstep#">

<!---Write Image to Temp Folder---> 
<cfset ImageWrite(reflectedImage, '#newimage#')>

<cfinclude template = "../frm/edit.cfm">